package com.akw.boot.contrroler;

import com.akw.boot.dto.StuDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello() {
        return "Hello, Spring Boot 3";
    }

    @GetMapping("/stu")
    public List<StuDto> stu() {
        List<StuDto> stus = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            StuDto s = new StuDto("akw" + i, 18 + i, "男");
            stus.add(s);
        }
        return stus;
    }
}
